//
//  LWSearchCityController.m
//  豆瓣
//
//  Created by 刘伟 on 16/7/7.
//  Copyright © 2016年 刘伟. All rights reserved.
//

#import "LWSearchCityController.h"
#import "LWChinaCityController.h"
#import "LWObroadController.h"
@interface LWSearchCityController ()<UIScrollViewDelegate>
@property (nonatomic, strong) NSMutableArray *viewControllers;
@property (nonatomic, strong) UIScrollView *backgroundScrollView;
@property (nonatomic, strong) UISegmentedControl *segmentedControl;
@property(nonatomic,strong)LWChinaCityController* china;
@property(nonatomic,strong)LWObroadController* ch;
@end

@implementation LWSearchCityController

//- (void)viewDidLoad {
//    [super viewDidLoad];
//    self.view.backgroundColor =KColor(233, 233, 233);
//    [self setsege];
//    [self setsearch];
//    [self loadScrollView];
//}
//-(void)setsege{
//    UISegmentedControl * page = [[UISegmentedControl
//                                  alloc]initWithItems:@[@"国内",@"国外"]];
//    self.navigationItem.titleView = page;
//    page.width = 180;
//    page.height = 30;
//    _segmentedControl = page;
//    page.selectedSegmentIndex = 0;
//    page.tintColor = TheThemeColor;
//    [page addTarget:self action:@selector(clickPage) forControlEvents:UIControlEventValueChanged ];
//}
//-(void)clickPage{
//    NSInteger selectedIndex = [self.segmentedControl selectedSegmentIndex];
//    
//    [self.backgroundScrollView setContentOffset:CGPointMake(SCREEN_WIDTH*selectedIndex, 0) animated:NO];
//}
//-(void)setsearch{
//    UISearchBar * search = [[UISearchBar alloc]init];
//    [self.view addSubview:search];
//    search.x= 0;
//    search.y = 64;
//    search.placeholder = @"输入城市名查询";
//    search.width = SCREEN_WIDTH;
//    search.height = 40;
//    search.backgroundImage = [UIImage imageNamed:@"searchBarBackImage"];
//    UITextField *txfSearchField = [search valueForKey:@"_searchField"];
//    txfSearchField.backgroundColor = KBackgroundColor;
//    LWChinaCityController * city = [[LWChinaCityController alloc]init];
//    [self addChildViewController:city];
//    self.china = city;
//    LWObroadController*o = [[LWObroadController alloc]init];
//    [self addChildViewController:o];
//    self.ch = o;
//    
//}
//- (void)loadScrollView{
//    
//    NSInteger viewCounts = 2;
//    
//    //初始化最底部的scrollView,装tableView用
//    self.backgroundScrollView = [[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds];
//    self.backgroundScrollView.backgroundColor = [UIColor whiteColor];
//    self.backgroundScrollView.pagingEnabled = YES;
//    self.backgroundScrollView.bounces = NO;
//    self.backgroundScrollView.showsHorizontalScrollIndicator = NO;
//    self.backgroundScrollView.delegate = (id<UIScrollViewDelegate>)self;
//    self.backgroundScrollView.contentSize = CGSizeMake(SCREEN_WIDTH * viewCounts, 0);
//    [self.view addSubview:self.backgroundScrollView];
//    
//    
//    for (int i = 0; i < viewCounts; i++) {
//        
//        UIViewController *listCtrl = self.childViewControllers[i];
//     
//        listCtrl.view.frame = CGRectMake(SCREEN_WIDTH*i, 40, SCREEN_WIDTH, SCREEN_HEIGHT);
//        [self.backgroundScrollView addSubview:listCtrl.view];
//    }
//    
//    [self.backgroundScrollView setContentOffset:CGPointMake(0, 0) animated:NO];
//    
//}
//
//- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
//    NSInteger pageIndex = (NSInteger)scrollView.contentOffset.x/SCREEN_WIDTH;
//    [_segmentedControl setSelectedSegmentIndex:pageIndex];
//}

@end
